package com.zmn.oms.common.discount.impl;

import com.zmn.oms.common.constant.OrderConsts;
import com.zmn.oms.common.discount.dto.CalculateDiscountListDTO;
import com.zmn.oms.common.discount.dto.CalculateDiscountResultDTO;
import com.zmn.oms.common.discount.interfaces.DiscountCalculator;

import java.util.List;

/**
 * 类描述：后台优惠
 *
 * @author heciqi
 * @date 2018/12/08 10:34
 */
public class OperatorDiscountCalculatorImpl extends AbsDiscountCalculatorImpl{

	/**
	 * 计算优惠金额
	 *
	 * @param origDiscounts 原有优惠列表
	 * @param initialAmount 初始金额（在该金额基础上计算优惠）
	 * @param calculator    回调实现各自计算
	 * @return 返回计算模型
	 */
	@Override
	public CalculateDiscountResultDTO calculate(List<CalculateDiscountListDTO> origDiscounts, Integer initialAmount, DiscountCalculator calculator) {
		CalculateDiscountResultDTO discountResultDTO = super.calculate(origDiscounts, initialAmount, calculator);

		discountResultDTO.setDiscountType(OrderConsts.ORDER_DISCOUNT_TYPE_LIMIT_FREE);
		discountResultDTO.setRemark("后台运营优惠");
		return discountResultDTO;
	}
}
